//
//  LLPublishCatoryVC.m
//  LoveLove
//
//  Created by leiyifan on 2019/5/26.
//  Copyright © 2019 wkf. All rights reserved.
//

#import "LLPublishCatoryVC.h"
#import "LLPublish2ViewController.h"

@interface LLPublishCatoryVC ()

@end

@implementation LLPublishCatoryVC

-(void)viewWillAppear:(BOOL)animated{
    [[IQKeyboardManager sharedManager] setEnable:NO];
    [super viewWillAppear:animated];
    [SVProgressHUD dismiss];
    self.navigationController.delegate = self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self titleView];
    self.titleLabel.text = @"发 布";
    [self.leftButton setTitle:@"上一步" forState:0];
    [self.leftButton setImage:nil forState:0];
    self.leftButton.frame = CGRectMake(20, self.navH-33, 80, 18);
    [self.leftButton setTitleColor:LLColorRGB(0) forState:0];
    self.leftButton.titleLabel.font = LLRegularFont(17);
//    [self.rightButton setTitle:@"确定" forState:0];
//    [self.rightButton setTitleColor:LLColor(249, 1, 0) forState:0];
//    self.rightButton.titleLabel.font = LLRegularFont(17);
//    self.rightButton.frame = CGRectMake(LLScreenWidth-100, self.navH-33, 80, 18);
    self.leftButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
//    self.rightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
    [self initView];
}
#pragma mark - 右上角的动作点击事件
- (void)didButtonWithrightButton{
    
}

-(void)initView{

   
    
    UIButton *xingqu = [UIButton buttonWithType:UIButtonTypeCustom];
    xingqu.tag = 200;
    [xingqu setTitle:@"兴趣" forState:UIControlStateNormal];
    [xingqu setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    xingqu.backgroundColor = [UIColor redColor];
    xingqu.layer.cornerRadius = 19;
    xingqu.layer.masksToBounds = YES;
    [xingqu addTarget:self action:@selector(selectedFenlei:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:xingqu];
    [xingqu mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view.mas_centerX);
        make.top.equalTo(self.view.mas_centerY);
        make.size.mas_equalTo(CGSizeMake(150, 38));
    }];
    UIButton *nianji = [UIButton buttonWithType:UIButtonTypeCustom];
    nianji.tag = 100;
    [nianji setTitle:@"年级" forState:UIControlStateNormal];
    [nianji setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    nianji.backgroundColor = [UIColor redColor];
    nianji.layer.cornerRadius = 19;
    nianji.layer.masksToBounds = YES;
    [nianji addTarget:self action:@selector(selectedFenlei:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:nianji];
    [nianji mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view.mas_centerX);
        make.bottom.equalTo(xingqu.mas_top).with.offset(-20);
        make.size.mas_equalTo(CGSizeMake(150, 38));
    }];
    
    UIButton *jineng = [UIButton buttonWithType:UIButtonTypeCustom];
    jineng.tag = 300;
    [jineng setTitle:@"技能" forState:UIControlStateNormal];
    [jineng setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    jineng.backgroundColor = [UIColor redColor];
    jineng.layer.cornerRadius = 19;
    jineng.layer.masksToBounds = YES;
    [jineng addTarget:self action:@selector(selectedFenlei:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:jineng];
    [jineng mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.view.mas_centerX);
        make.top.equalTo(xingqu.mas_bottom).with.offset(20);
        make.size.mas_equalTo(CGSizeMake(150, 38));
    }];

}

-(void)selectedFenlei:(UIButton *)button{
    
    LLPublish2ViewController *vc = [LLPublish2ViewController new];
    vc.name = self.name;
    vc.conent = self.conent;
    vc.imageArr = self.imageArr;
    vc.type = self.type;
    vc.newsType = button.tag;
     vc.isVideo = self.isVideo;
    [self.navigationController pushViewController:vc animated:YES];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
